package com.ccb.jyzx.expand.tiantouonline.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.SchedulingConfigurer;
import org.springframework.scheduling.config.ScheduledTaskRegistrar;

import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
 * @author XIEFEI
 * @date 2019-01-14 15:17
 * @Description springboot定时调度多线程
 **/
@Configuration
public class ScheduleConfig implements SchedulingConfigurer {
    @Override
    public void configureTasks(ScheduledTaskRegistrar scheduledTaskRegistrar) {
        //参数传入一个size为5的线程池
        scheduledTaskRegistrar.setScheduler(new ScheduledThreadPoolExecutor(5));
    }
}
